package dp.component;

import java.util.Iterator;

import dp.component.baseclass.MenuComponent;

public class Waitress {

	MenuComponent allMenus;
	
	public Waitress(MenuComponent allMenus) {
		this.allMenus = allMenus;
	}
	
	public void printMenu() {
		allMenus.print();
	}
	
	public void printVegetarianMenu() {
		Iterator<MenuComponent> iter = allMenus.createIterator();
		System.out.println("\nVegetarian MENU\n----");
		while(iter.hasNext()) {
			MenuComponent menuComponent = iter.next();
			if(menuComponent.isVegetarian())
			{
				menuComponent.print();
			}
		}
	}
}
